import numpy as np
from PIL import Image

pic=Image.open("BTD.jpg")
print(type(pic))
im=np.array(pic)
print(im.shape,im.dtype,im.ndim,im.itemsize)
print(im.flags)
print(im)
a=[255,255,255] - im
newim=Image.fromarray(a.astype('uint8'))
newim.save("BTD2.jpg")

b = [0.5,0.5,0.5] * im +[256*0.25 -1 ,256*0.25 -1 ,256*0.25 -1]
newim=Image.fromarray(b.astype('uint8'))
newim.save("BTD3.jpg")

c = [0.25,0.25,0.25] * im
newim=Image.fromarray(c.astype('uint8'))
newim.save("BTD4.jpg")